<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- zTree -->
	<script type="text/javascript" src="/js/libs/jquery-1.10.2.min.js"></script>
	<link rel="stylesheet" href="/css/zTreeStyle/zTreeStyle.css">
	<script type="text/javascript" src="/js/jquery.ztree.all-3.5.js"></script>
	<script type="text/javascript">
		$(function() {
			initTree();
		})
		
		function initTree() {
			$.ajax({
				url:"/dict/json",
				dataType:"json"
			}).done(function(data){
				$.fn.zTree.init($("#dict-tree"), {
					data: {
						simpleData: {
							enable: true
						}
					},
					callback: {
						onClick:function(event, treeId, treeNode) {
							window.parent.pid = treeNode.pId;
							window.parent.id = treeNode.id;
							//$(window.parent.document).find("#test1").val("id="+treeNode.id);
							//$(window.parent.document).find("#test2").val("pid="+treeNode.pId);
							window.parent.turnpage(1);
						}
					}
				}, data);
			})
		}
	</script>
</head>
<body>
	<ul id="dict-tree" class="ztree">
</body>
</html>